'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 matrixmod
.ds Xs 9532 4 matrixmode.gl
.TH GLMATRIXMODE 3G
.SH NAME
.B "glMatrixMode
\- specify which matrix is the current matrix

.SH C SPECIFICATION
void \f3glMatrixMode\fP(
GLenum \fImode\fP )
.nf
.fi

.SH PARAMETERS
.TP \w'\f2mode\fP\ \ 'u 
\f2mode\fP
Specifies which matrix stack is the target
for subsequent matrix operations.
Three values are accepted:
\%\f3GL_MODELVIEW\fP,
\%\f3GL_PROJECTION\fP, and
\%\f3GL_TEXTURE\fP.
The initial value is \%\f3GL_MODELVIEW\fP.
.TE

Additionally, if the \%\f3GL_ARB_imaging\fP extension is supported,
\%\f3GL_COLOR\fP is also accepted.
.SH DESCRIPTION
\%\f3glMatrixMode\fP sets the current matrix mode.
\f2mode\fP can assume one of four values:
.TP 25
\%\f3GL_MODELVIEW\fP
Applies subsequent matrix operations to the modelview matrix stack.
.TP
\%\f3GL_PROJECTION\fP
Applies subsequent matrix operations to the projection matrix stack.
.TP
\%\f3GL_TEXTURE\fP
Applies subsequent matrix operations to the texture matrix stack.
.TP
\%\f3GL_COLOR\fP
Applies subsequent matrix operations to the color matrix stack.
.P
To find out which matrix stack is currently the target of all matrix
operations, call \%\f3glGet\fP with argument \%\f3GL_MATRIX_MODE\fP. The initial
value is \%\f3GL_MODELVIEW\fP.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2mode\fP is not an accepted value.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glMatrixMode\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_MATRIX_MODE\fP
.SH SEE ALSO
\%\f3glLoadMatrix(3G)\fP,
\%\f3glPushMatrix(3G)\fP
